package com.codenum.codegenerator;

import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;
import java.util.HashMap;
import java.util.Map;
import java.util.Objects;

/**
* the Ztjhkmom type
*/
@SuppressWarnings("ALL")
public class Ztjhkmom {


        private static volatile Ztjhkmom instance;

        /**
        * 方法MethodMap
        */
        private Map<String, Method> methodMap = new HashMap<>(32);

        private Map<String, Object> saleTypeMap = new HashMap<>(64);

        public static Ztjhkmom getInstance() {
            if (instance == null) {
                synchronized (Ztjhkmom.class) {
                    if (instance == null) {
                        instance = new Ztjhkmom();
                    }
                }
            }
            return instance;
        }


        private Ztjhkmom() {

        }



    public  Boolean judgeFtafgtsdvs(String saleType){
        String methodName = Thread.currentThread().getStackTrace()[1].getMethodName();
        return judgeAttributeValue(saleType, methodName);
    }
    public  Boolean judgeWkovchyuey(String saleType){
        String methodName = Thread.currentThread().getStackTrace()[1].getMethodName();
        return judgeAttributeValue(saleType, methodName);
    }
    public  Boolean judgeNogixhmmco(String saleType){
        String methodName = Thread.currentThread().getStackTrace()[1].getMethodName();
        return judgeAttributeValue(saleType, methodName);
    }
    public  Boolean judgePhgbmfkiwu(String saleType){
        String methodName = Thread.currentThread().getStackTrace()[1].getMethodName();
        return judgeAttributeValue(saleType, methodName);
    }
    public  Boolean judgeEpncowwnkz(String saleType){
        String methodName = Thread.currentThread().getStackTrace()[1].getMethodName();
        return judgeAttributeValue(saleType, methodName);
    }
    public  Boolean judgeExiszljwfo(String saleType){
        String methodName = Thread.currentThread().getStackTrace()[1].getMethodName();
        return judgeAttributeValue(saleType, methodName);
    }
    public  Boolean judgeLgmzvzkrbx(String saleType){
        String methodName = Thread.currentThread().getStackTrace()[1].getMethodName();
        return judgeAttributeValue(saleType, methodName);
    }
    public  Boolean judgeYmayicbfai(String saleType){
        String methodName = Thread.currentThread().getStackTrace()[1].getMethodName();
        return judgeAttributeValue(saleType, methodName);
    }
    public  Boolean judgeZyzuyyqbru(String saleType){
        String methodName = Thread.currentThread().getStackTrace()[1].getMethodName();
        return judgeAttributeValue(saleType, methodName);
    }
    public  Boolean judgeOuzhwrikld(String saleType){
        String methodName = Thread.currentThread().getStackTrace()[1].getMethodName();
        return judgeAttributeValue(saleType, methodName);
    }

    private String  ftafgtsdvs;
    private String  wkovchyuey;
    private String  nogixhmmco;
    private String  phgbmfkiwu;
    private String  epncowwnkz;
    private String  exiszljwfo;
    private String  lgmzvzkrbx;
    private String  ymayicbfai;
    private String  zyzuyyqbru;
    private String  ouzhwrikld;


    public void setFtafgtsdvs(String ftafgtsdvs){
    this.ftafgtsdvs = ftafgtsdvs;
    }

    public String getFtafgtsdvs(){
    return this.ftafgtsdvs;
    }
    public void setWkovchyuey(String wkovchyuey){
    this.wkovchyuey = wkovchyuey;
    }

    public String getWkovchyuey(){
    return this.wkovchyuey;
    }
    public void setNogixhmmco(String nogixhmmco){
    this.nogixhmmco = nogixhmmco;
    }

    public String getNogixhmmco(){
    return this.nogixhmmco;
    }
    public void setPhgbmfkiwu(String phgbmfkiwu){
    this.phgbmfkiwu = phgbmfkiwu;
    }

    public String getPhgbmfkiwu(){
    return this.phgbmfkiwu;
    }
    public void setEpncowwnkz(String epncowwnkz){
    this.epncowwnkz = epncowwnkz;
    }

    public String getEpncowwnkz(){
    return this.epncowwnkz;
    }
    public void setExiszljwfo(String exiszljwfo){
    this.exiszljwfo = exiszljwfo;
    }

    public String getExiszljwfo(){
    return this.exiszljwfo;
    }
    public void setLgmzvzkrbx(String lgmzvzkrbx){
    this.lgmzvzkrbx = lgmzvzkrbx;
    }

    public String getLgmzvzkrbx(){
    return this.lgmzvzkrbx;
    }
    public void setYmayicbfai(String ymayicbfai){
    this.ymayicbfai = ymayicbfai;
    }

    public String getYmayicbfai(){
    return this.ymayicbfai;
    }
    public void setZyzuyyqbru(String zyzuyyqbru){
    this.zyzuyyqbru = zyzuyyqbru;
    }

    public String getZyzuyyqbru(){
    return this.zyzuyyqbru;
    }
    public void setOuzhwrikld(String ouzhwrikld){
    this.ouzhwrikld = ouzhwrikld;
    }

    public String getOuzhwrikld(){
    return this.ouzhwrikld;
    }

    void setMethodMap(Map<String, Method> methodMap) {
        this.methodMap = methodMap;
    }

   void setSaleTypeMap(Map<String, Object> saleTypeMap) {
        this.saleTypeMap = saleTypeMap;
    }

    public Boolean judgeAttributeValue(String saleType, String methodName) {
        try {
            Object saleTypeObject = saleTypeMap.get(saleType);
            String targetMethod = methodName.replace("judge", "get");
            String attr = methodName.replace("judge", "");
            Method method = methodMap.get(targetMethod);
            Object invoke = method.invoke(saleTypeObject);
            return Objects.isNull(invoke) ? Boolean.FALSE : Objects.equals(invoke.toString().toLowerCase(), attr.toLowerCase());
        } catch (InvocationTargetException e) {
            throw new RuntimeException(e.getMessage());
        } catch (IllegalAccessException e) {
            throw new RuntimeException(e.getMessage());
        }
    }

}